' Test oh ao command poll with mouse and key variables.txt b+ 2021-03-14
' let's get right and left in here too.
[
	poll
	cls
	. press q to quit... (escape is caught by oh) 
	.
	. mouse x ;mousex
	. mouse y ;mousey
	. mouse left button down ;mousel
	. mouse right button down ;mouser
	.
	. Analyzing last key press Chr:
	lk = len[key]
	. len of last key is ;lk
	if eq[lk,2]
		. Key had length of 2 asc(char1), asc(char2):
		. asc[left[key,1]];, ;asc[right[key,1]]
	el
		. Key had length of 1 asc(char), char:
		. asc[key];, ;key
	fi
	show -1
	wait .005
	jmp seq[key,q]
]
cls
. you pressed q to quit!
.
. mouse x ;mousex
. mouse y ;mousey
. mouse left button down ;mousel
. mouse right button down ;mouser
.
. Analyzing last key press Chr:
lk = len[key]
. len of last key is ;lk
if eq[lk,2]
	. Key had length of 2 asc(char1), asc(char2):
	. asc[mid1[key,1]];, ;asc[mid1[key,2]]
el
	. Key had length of 1 asc(char), char:
	. asc[key];, ;key
fi		
.
. zzz End of poll test, goodbye! press any
show -1
zzz